package com.jxc.model.po;

/***********************************************************************
 * Module:  User.java
 * Author:  Tino
 * Purpose: Defines the Class User
 ***********************************************************************/

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * 用户
 * 
 * @pdOid e112a429-eaf4-41ab-a37f-349d44009d02
 */
@Entity
@Table(name = "QXGL_USER")
public class User extends IdEntity implements Serializable {
	/**
	 * 
	 */
	private static final long serialVersionUID = -2827038968263632512L;
	/**
	 * 用户名
	 * 
	 */
	private String username;
	/**
	 * 用户真实姓名
	 * 
	 * @pdOid 43f3d6d9-e997-4cd3-ac0a-f7bf9f7abc0b
	 */
	private String realName;
	/**
	 * 性别
	 * 
	 * @pdOid 39c02d38-3831-42e3-92d5-41056038f5be
	 */
	private String sex;
	/**
	 * 学历
	 * 
	 * @pdOid 9acfbc75-705c-4ba1-b20a-4bca42c0c8ec
	 */
	private String education;
	/**
	 * 手机
	 * 
	 * @pdOid 7e8252fe-4ba5-4f21-90a9-6e3ecb7d9fbc
	 */
	private String mobile;
	/**
	 * QQ号码
	 * 
	 * @pdOid 487e4929-0b6d-465e-bf42-df95c2b9b7b6
	 */
	private String qq;
	/**
	 * MSN号码
	 * 
	 * @pdOid c4b17b68-4ad5-438f-af46-f30f8bcce79a
	 */
	private String msn;
	/**
	 * Email
	 * 
	 * @pdOid 1c5bb74b-b948-49b0-957d-39beccba1d68
	 */
	private String email;
	/**
	 * 出生日期
	 * 
	 * @pdOid 49ec1c46-6c27-4b8e-9eb9-103484ed92a3
	 */
	private Date birthday;
	/**
	 * 身份证号
	 * 
	 * @pdOid 1bf60ee3-bd7b-447e-b692-1946b12aad29
	 */
	private String idCard;
	/**
	 * 民族
	 * 
	 * @pdOid 50909dfc-ef2e-40c7-9b12-3c1b80417e5b
	 */
	private String nation;
	/**
	 * 婚否
	 * 
	 * @pdOid 4a582d2a-ede6-4a92-9def-a03ae548e476
	 */
	private String isMarry;
	/**
	 * 雇佣性质
	 * 
	 * @pdOid 34371bdd-2c48-4f76-88d7-db0eb7cd0015
	 */
	private String employType;
	/**
	 * 所在部门
	 * 
	 * @pdOid 41f0c99a-3d00-427a-91f1-1a30e4d753ca
	 */
	private String dept;
	/**
	 * 部门编号
	 * 
	 * @pdOid aed65c07-d636-420e-b4b5-fd79d538fa50
	 */
	private String deptNo;
	/**
	 * 现任职务
	 * 
	 * @pdOid 03a9df21-9ebb-4eb3-8208-cc76574c3d1f
	 */
	private String job;
	/**
	 * 人事状态
	 * 
	 * @pdOid d5d1cab7-df6c-40df-81e2-e29422b546b5
	 */
	private String hire;
	/**
	 * 家庭电话
	 * 
	 * @pdOid 8af997b1-cc08-4172-b9ac-a7127b473202
	 */
	private String tel;
	/**
	 * 家庭地址
	 * 
	 * @pdOid f63a7bf8-7342-4458-ae85-7fb97b43c9f0
	 */
	private String adress;
	/**
	 * 特长
	 * 
	 * @pdOid 9db18d68-3b9a-4089-9add-2e8bc2f2605d
	 */
	private String skill;
	/**
	 * 备注
	 * 
	 * @pdOid 16a5e36f-56fa-4e61-bd75-ebeb6b1d1c26
	 */
	private String remark;
	/**
	 * 用户密码
	 * 
	 * @pdOid f63f227e-a2bf-4fed-970e-59b7ba3733cd
	 */
	private String password;
	/**
	 * 用户角色
	 * 
	 * @pdOid fd90092a-720e-4f72-94b5-5a8002ee6fdf
	 */
	private Role role;
	/**
	 * 机器码
	 * 
	 * @pdOid 8ce3f666-dabb-4cb1-80ab-baee70c55c2b
	 */
	private String robotCode;
	/**
	 * IP
	 * 
	 * @pdOid ed35192f-4c77-4a64-852a-ad468b64dc2b
	 */
	private String ip;
	/**
	 * 放大倍数
	 * 
	 * @pdOid f0d68e72-ac3f-44f9-b410-b0b7dcefdae9
	 */
	private Double rate;
	/**
	 * 用户状态 默认为1 有效用户 0失效用户
	 * 
	 * @pdOid 1bef4cb3-205b-443a-9582-2b4c60b66eef
	 */
	private Integer status;
	/**
	 * 用户仓库
	 * 
	 */
	private Repertory repertory;
	/**
	 * 仓库所属经销商
	 */
	private User user;
	/**
	 * 用户类型 1:管理员，2：代理商，3:营业员
	 */
	private Integer userType;
	/**
	 * 用户资源
	 * 
	 */
	private List<UserResource> userResources = new ArrayList<UserResource>();
	/**
	 * 创建时间
	 */
	private Date createTime;
	/**
	 * 有效日期
	 */
	private Date validDate;
	/**
	 * 失效日期
	 */
	private Date expiryDate;
	/**
	 * 是否删除
	 */
	private Boolean isDeleted;

	public User(){
		super();
	}
	
	public User(Long id) {
		super(id);
	}

	@Column(name = "USER_NAME")
	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	@Column(name = "REAL_NAME")
	public String getRealName() {
		return realName;
	}

	public void setRealName(String realName) {
		this.realName = realName;
	}

	@ManyToOne
	@JoinColumn(name = "REPERTORY_ID")
	public Repertory getRepertory() {
		return repertory;
	}

	public void setRepertory(Repertory repertory) {
		this.repertory = repertory;
	}
	@ManyToOne
	@JoinColumn(name = "USER_ID")
	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	@Column(name = "SEX")
	public String getSex() {
		return sex;
	}

	public void setSex(String sex) {
		this.sex = sex;
	}

	@Column(name = "EDUCATION")
	public String getEducation() {
		return education;
	}

	public void setEducation(String education) {
		this.education = education;
	}

	@Column(name = "MOBILE")
	public String getMobile() {
		return mobile;
	}

	public void setMobile(String mobile) {
		this.mobile = mobile;
	}

	@Column(name = "QQ")
	public String getQq() {
		return qq;
	}

	public void setQq(String qq) {
		this.qq = qq;
	}

	@Column(name = "MSN")
	public String getMsn() {
		return msn;
	}

	public void setMsn(String msn) {
		this.msn = msn;
	}

	@Column(name = "EMAIL")
	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	@Column(name = "BIRTHDAY")
	public Date getBirthday() {
		return birthday;
	}

	public void setBirthday(Date birthday) {
		this.birthday = birthday;
	}

	@Column(name = "ID_CARD")
	public String getIdCard() {
		return idCard;
	}

	public void setIdCard(String idCard) {
		this.idCard = idCard;
	}

	@Column(name = "NATION")
	public String getNation() {
		return nation;
	}

	public void setNation(String nation) {
		this.nation = nation;
	}

	@Column(name = "IS_MARRY")
	public String getIsMarry() {
		return isMarry;
	}

	public void setIsMarry(String isMarry) {
		this.isMarry = isMarry;
	}

	@Column(name = "EMPLOY_TYPE")
	public String getEmployType() {
		return employType;
	}

	public void setEmployType(String employType) {
		this.employType = employType;
	}

	@Column(name = "DEPT")
	public String getDept() {
		return dept;
	}

	public void setDept(String dept) {
		this.dept = dept;
	}

	@Column(name = "DEPT_NO")
	public String getDeptNo() {
		return deptNo;
	}

	public void setDeptNo(String deptNo) {
		this.deptNo = deptNo;
	}

	@Column(name = "JOB")
	public String getJob() {
		return job;
	}

	public void setJob(String job) {
		this.job = job;
	}

	@Column(name = "HIRE")
	public String getHire() {
		return hire;
	}

	public void setHire(String hire) {
		this.hire = hire;
	}

	@Column(name = "TEL")
	public String getTel() {
		return tel;
	}

	public void setTel(String tel) {
		this.tel = tel;
	}

	@Column(name = "ADRESS")
	public String getAdress() {
		return adress;
	}

	public void setAdress(String adress) {
		this.adress = adress;
	}

	@Column(name = "SKILL")
	public String getSkill() {
		return skill;
	}

	public void setSkill(String skill) {
		this.skill = skill;
	}

	@Column(name = "REMARK")
	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	@Column(name = "PASSWORD")
	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	@ManyToOne
	@JoinColumn(name = "ROLE_ID")
	public Role getRole() {
		return role;
	}

	public void setRole(Role role) {
		this.role = role;
	}

	@Column(name = "ROBOT_CODE")
	public String getRobotCode() {
		return robotCode;
	}

	public void setRobotCode(String robotCode) {
		this.robotCode = robotCode;
	}

	@Column(name = "IP")
	public String getIp() {
		return ip;
	}

	public void setIp(String ip) {
		this.ip = ip;
	}

	@Column(name = "RATE", length = 10, precision = 2)
	public Double getRate() {
		return rate;
	}

	public void setRate(Double rate) {
		this.rate = rate;
	}

	@Column(name = "STATUS")
	public Integer getStatus() {
		return status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}

	@OneToMany(mappedBy = "user")
	public List<UserResource> getUserResources() {
		return userResources;
	}

	public void setUserResources(List<UserResource> userResources) {
		this.userResources = userResources;
	}

	@Column(name = "CREATETIME")
	public Date getCreateTime() {
		return createTime;
	}

	@Column(name = "USER_TYPE")
	public Integer getUserType() {
		return userType;
	}

	public void setUserType(Integer userType) {
		this.userType = userType;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	@Column(name = "VALIDDATE")
	public Date getValidDate() {
		return validDate;
	}

	public void setValidDate(Date validDate) {
		this.validDate = validDate;
	}

	@Column(name = "EXPIRYDATE")
	public Date getExpiryDate() {
		return expiryDate;
	}

	public void setExpiryDate(Date expiryDate) {
		this.expiryDate = expiryDate;
	}
	@Column(name = "ISDELETED")
	public Boolean getIsDeleted() {
		return isDeleted;
	}

	public void setIsDeleted(Boolean isDeleted) {
		this.isDeleted = isDeleted;
	}

}